package card;

import PJ.Entrance;
import PJ.Player;
import place.Landindex;

public class DemolitionCard extends CardSystem{
	//拆迁卡
	String name="DemolitionCard";
	String function="该街道所有土地房产全部重置为初始无主状态，原房主得到房屋当前价格*150%的补偿费。";	
	String type="ToolCard";
	String range="停留地的整条街道";
	DemolitionCard(){
		int point=20;
		this.point=point;
	}	
	@Override
	public int getPoint() {
		return point;
	}
	@Override
	public String getName() {
		
		return name;
	}

	@Override
	public String getFunction() {
		// TODO Auto-generated method stub
		return function;
	}

	@Override
	public String getType() {
		// TODO Auto-generated method stub
		return type;
}

	@Override
	public String getRange() {
		// TODO Auto-generated method stub
		return range;
	}
	@Override
	public void print(int location, int namei) {
		Player playerow=new Player();
		for(int i=0;i<Entrance.players.size();i++){
			if(Entrance.players.get(i).getNamei()==Landindex.mark[location].owner){
				playerow=Entrance.players.get(i);
			}
		}	
		if(Landindex.mark[location].owner!=0){
			playerow.setCash(playerow.getCash()+Landindex.mark[location].price*1.5);
			Landindex.mark[location].level=1;
			Landindex.mark[location].owner=0;
			System.out.println("卡牌使用成功");
		}
		if(Landindex.mark[location].owner==0){
			System.out.println("很不幸，拆迁大队白跑了一趟，您浪费了一张拆迁卡");
		}
	}
}